import json
import re

import requests
from lxml import etree
from urllib.parse import urlencode


# book_name = '史上最强赘婿'
# header = {
#     'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36',
# }
#
# parmas = {
#     'id' : '12024',
# }
# # post_parmas = urlencode(parmas)
#
# res = requests.post('https://www.zxcs.info/download1.php',headers=header,data=parmas)
# # res = requests.get('https://www.zxcs.info/download1.php?id=12024',headers=header)
# # res.encoding = res.apparent_encoding # 防止乱码，自动转码
# res_page = res.text
#
# print(res)
# print(res_page)

a = """
<script>
	$(".localdown").click(function(){
		down();
	});
	
	function down() {
		var url="http://207.246.114.172";
		$.ajax({
			url: '/download1.php',
			type: 'POST',
			data: {id:12024},
			success: function(result){
				if(result!=""){
					window.location.href=url+result;
					//window.open(url+result);
				}
			}
		 });
	}
</script>
"""

b = re.findall('data:(.*?),\n',a,re.S)
print(b[0].strip())